package casino;

import java.awt.Graphics2D;
import java.awt.event.MouseEvent;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.*;
public class NetworkMenu extends Menu {
	
	public NetworkMenu(Menu m){
		super(m);
		init();
	}
	
	@SuppressWarnings("serial")
	private void init(){
		elements.add(new MenuList(this, 100, 50, 900, 800, 20, 40, 50){
			public void init(){
				LANTester lan = new LANTester(this);
				lan.start();
			}
			
			public void clicked(MouseEvent e){
				add("lol");
				super.clicked(e);/*
				Socket client;
				PrintWriter toClient;
				BufferedReader fromClient;
				if(cur != -1){
					try {
						client = new Socket(InetAddress.getByName(elements.get(cur)), 4444);
						toClient = new PrintWriter(client.getOutputStream(), true);
						fromClient = new BufferedReader(new InputStreamReader(client.getInputStream()));
					}catch (UnknownHostException e1) {
						e1.printStackTrace();
					} catch (IOException e2) {
						e2.printStackTrace();
					}
				}
				*/
			}
		});
	}
	
	public void draw(Graphics2D g){
		super.draw(g);
	}
}
